<% Option Explicit %> <% '--------------------------------------------------------- ' Page: forum/default.asp ' Purpose: Lists all messages for a particular forum ' category as well as the number of hits. ' Version: 1.0 ' Author: Rafael Queiro ' Created: February 25, 2000 ' Called by: /forums/default.asp ' Security: Everyone '--------------------------------------------------------- %> <% Const DEFAULT_PAGE_SIZE = 30 Dim strHTML Dim objTasks Dim varQuery Dim gintCatID Dim gstrCategory gintCatID = int(Request("icatid")) If gintCatID <= 0 then Response.Redirect "index.html" gstrCategory = GetCategoryName (gintCatID) Function GetCategoryName (iCatID) Dim objForum Dim objRS Dim sProc Set objForum = CreateObject("dbAccess.clsExecutes") objForum.ConnectionString = Application("dbConnection") sProc = "Select strCategoryName from tbl_Forum_Categories where intCatID = " & iCatID Set objRS = objForum.ExecuteDisconnectedSQL (sProc) IF not objRS.EOF and Not objRS.BOF then GetCategoryName = objRS.Fields("strCategoryName") End If Set objRs = Nothing Set objForum = nothing End Function Function Zero2Null(iNum) If int(iNum)=0 then Zero2Null = "" Else Zero2Null = iNum End Function %> <!-- #include virtual="/resources/global/glbTitle.asp" -->- Bulletin Board

BULLETIN BOARD

<%=gstrCategory %>
 

<% Dim objConn Dim SQLQuery Dim sQLProc Dim objFRs Dim objForums Set objForums = Server.CreateObject("dbAccess.clsExecutes") objForums.ConnectionString = Application("dbConnection") sQLProc = "sp_ForumsByCategory " & gintCatID Set objFRS = objForums.ExecuteProc(sQLProc) If Not objFRS.EOF and Not objFRS.BOF then Dim vstrMsg Dim vintMsgCnt Dim vstrFrom Dim vdtWhen Dim vintID Dim intIdx Dim intRecs Dim RecIdx Dim vBgColor Dim vClass Dim vtmpMsg Dim intPageNo Dim intTotalPages Dim lastRecordonPage Dim x,y,sBold,sBoldEnd Dim moveTo Dim strDestPage strDestPage = "GroupForum.asp" moveTo = int(Request("mv")) objFRS.PageSize = DEFAULT_PAGE_SIZE If intPageNo = "" then intPageNo = 1 intTotalPages = objFRS.PageCount objFRS.AbsolutePage = intPageNo intRecs = objFRS.RecordCount If int(moveTo) > 0 then objFRS.Move int(moveTo) RecIdx = objFRs.RecordCount - moveTo intIdx = 1 Do while Not objFRS.EOF And (intIdx <= objFRS.PageSize) if intIdx MOD 2 then vBgColor = "" Else vBgColor = " BgColor = '#E6DCB2'" vtmpMsg = vstrMsg strHTML = strHTML & "" & vbNewLine strHTML = strHTML & "" strHTML = strHTML & "" & vbNewLine strHTML = strHTML & "" & vbNewLine strHTML = strHTML & "" & vbNewLine strHTML = strHTML & "" strHTML = strHTML & "" strHTML = strHTML & "" & vbNewLine objFRS.MoveNext intIdx = intIdx + 1 RecIdx = RecIdx - 1 Loop strHTML = strHTML & "" & vbnewLine Else strHTML = "" strHTML = strHTML _ & "" & vbNewLine _ & "" & vbNewLine _ & "" & vbNewLine End if Response.write strHTML If intIdx > 10 then %> <% End if If objFRS.PageCount > 1 then %> <% End If %>
Messages posted on this board are secured and viewed by all the members of the group. Feel free to post messages as well as respond to previously posted messages.
    
# Subject Author Message Reps Date/Time
" & RecIdx & "" & "" & objFRS.Fields("strSubject") & "" & "" & objFRS.Fields("strFrom") & "" & CompactString(objFRS.Fields("txtBody"), 38) & "" & Zero2Null(objFRS.Fields("intMsgCount")) & "" & objFRS.Fields("dtWhen") & "

" & vbNewLine _ & "   No Messages found!!. Click here to post a new message
 
" _ & "
    
<% LastRecordOnPage = objFRs.Pagesize + int(moveTo) If ((objFRS.RecordCount <> -1) AND (objFRS.RecordCount < lastRecordOnPage)) then lastRecordOnPage = objFRs.RecordCount end if Response.write "Records " & 1 + int(moveTo) & " to " & lastRecordOnPage & " of " & objFRS.RecordCount %>

<% If int(moveTo) > 0 then %> Previous Page   <% End if x = (int(moveTo) \ (50*(objFRS.PageSize))) * objFRs.PageSize y = x + objFRS.PageSize do while (x*objFRS.PageSize) < objFRS.RecordCount and x <= y If (x * objFRS.PageSize) <> int(moveTo) then sBold = "" sBoldEnd = "" Else sBold = "" sBoldEnd = "" End if Response.Write "|" %> <%=sBold %><%=x + 1 %><%=sBoldEnd %> <% If Right(Cstr((x - 24) / 5), 1) = 0 Then Response.write "
" End if x = x + 1 Loop Response.Write "|" %>  <% If (int(moveto) + objFRs.PageSize) < objFRs.RecordCount then %> Next Page <% End if %>